package com.jy.api.util;import javax.validation.ConstraintViolation;import java.util.HashSet;import java.util.Set;public class ParseErrors {    public static Set<String> parseErrors(Set errors) {        Set<String> result = new HashSet<String>();        for (Object error : errors) {            ConstraintViolation e = (ConstraintViolation) error;            result.add(String.format("%s %s", e.getPropertyPath(), e.getMessage()));        }        return result;    }    public static String getErrors(Set errors) {        for (Object error : errors) {            ConstraintViolation e = (ConstraintViolation) error;            return e.getMessage();        }        return null;    }}